﻿<%@ page contentType="text/html; charset=UTF-8" language="java" import="java.sql.*"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/themes/icon.css">
<LINK href="${pageContext.request.contextPath}/css/admin.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.easyui.min.js"></script>
<script type="text/javascript">
  $(document).ready(function(){
   $('#list_table tr:odd').addClass('odd');
   $('#list_table tr:even').addClass('even');
   $('#list_table tr').hover(function() {
     $(this).addClass("hover");
   },function(){
     $(this).removeClass("hover");
   }); 
});

</script>
</HEAD>
<BODY>
<form action="${pageContext.request.contextPath }/servlet/AdminServlet?method=save" method="post" >
<!--导航部分-->
<div id="u_daohang"><span class="textc1">当前位置：</span><span class="textc2">系统管理</span>&nbsp;&gt;&nbsp;用户管理</div>
<!--导航部分-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="pub_table2" style="margin-top:10px; table-layout:fixed;">
  <tr>
    <th width="110">登录用户名：</th>
    <td width="140">
    	<input name="username" type="text" class="texta" style="width:120px;" onfocus="this.className='textb';" onblur="this.className='texta';" />
    	${message.error.username } ${exist }
    </td>
    <th width="110">登录密码：</th>
    <td>
    	<input name="password" type="text" class="texta" style="width:120px;" onfocus="this.className='textb';" onblur="this.className='texta';" />
    	${message.error.password }
    </td>
  </tr>
  <tr>
    <th>姓名：</th>
    <td>
    	<input name="name" type="text" class="texta" style="width:120px;" onfocus="this.className='textb';" onblur="this.className='texta';" />
    	${message.error.name }
    </td>
    <th>联系电话：</th>
    <td>
    	<input name="phone" type="text" class="texta" style="width:120px;" onfocus="this.className='textb';" onblur="this.className='texta';" />
    	${message.error.phone }
    </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td height="42" colspan="3"><input type="submit" value="保存" /></td>
  </tr>
  
</table>

  <c:if test="${smuser[0]==null}">
  
  	sorry···· 暂时没有数据，请录入数据！
  
  </c:if>
 <c:if test="${smuser[0]!=null}">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="pub_table" id="list_table" style="margin-top:5px; table-layout:fixed;">
  <tr>
    <th width="180">登录用户名</th>
    <th width="80">姓名</th>
    <th width="90">联系电话</th>
    <th width="90">操作</th>
  </tr>

  <c:forEach var="sm" items="${smuser}">
  <tr>
    <td align="center">${sm.username }</td>
    <td align="center">${sm.name }</td>
    <td align="center">${sm.phone }</td>
    <td align="center"><a href="${pageContext.request.contextPath }/servlet/HtEditAdminPage?id=${sm.id}">编辑</a>&nbsp;|&nbsp;<a href="${pageContext.request.contextPath }/servlet/AdminServlet?method=delete&id=${sm.id}">删除</a>
  |&nbsp;
  <c:if test="${sm.islock==0}">
  <a href="${pageContext.request.contextPath }/servlet/AdminServlet?method=unlock&id=${sm.id}">锁定</a>
  </c:if>
  <c:if test="${sm.islock ==1}">
  <a href="${pageContext.request.contextPath }/servlet/AdminServlet?method=lock&id=${sm.id}">解锁</a>
  </c:if>
  </td>
  </tr>
  </c:forEach>
</table>
 </c:if>
</form>
</BODY>
</HTML>